﻿using BenCaoXuan.Infrastructure.Attr;
using BenCaoXuan.Infrastructure.Dto.PC;
using BenCaoXuan.Service.Interface.admin;
using BenCaoXuan.Service.Interface.PC;
using Microsoft.AspNetCore.Mvc;

namespace BenCaoXuan.Api.Admin.Controllers.pc
{
    [ApiGroup("PC(桌面端模块)")]
    public class SysController : BaseController
    {
        private readonly Service.Interface.PC.I_Sys_Service _i_Sys_Service;

        public SysController(I_Login_Service login_Service, Service.Interface.PC.I_Sys_Service i_Sys_Service) : base(login_Service)
        {
            _i_Sys_Service=i_Sys_Service;
        }



        /// <summary>
        /// 获取预约商品
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_Appointment_Product(int? page = 1, int? limit = 10, string? key = "")
        {
            var result = await _i_Sys_Service.Get_Appointment_Product(new Product_Dto
            {
                limit = limit ?? 10,
                page = page ?? 1,
                key = key ?? ""
            });

            return Ok(result);
        }


        /// <summary>
        /// 获取客户(搜索)
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> GetCustoms(int? page = 1, int? limit = 10, string? key = "")
        {
            var result = await _i_Sys_Service.GetCustoms(new Infrastructure.Dto.PC.Customs_Dto
            {
                limit = limit ?? 10,
                page = page ?? 1,
                key = key ?? ""
            });

            return Ok(result);
        }

        /// <summary>
        /// 获取客户页面(搜索)
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_All_Customs(int? page = 1, int? limit = 10, string? key = "")
        {
            var result = await _i_Sys_Service.Get_All_Customs(new Infrastructure.Dto.PC.Customs_Dto
            {
                limit = limit ?? 10,
                page = page ?? 1,
                key = key ?? ""
            });

            return Ok(result);
        }


        /// <summary>
        /// 获取选中日期排班
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_Arrange(string begin, string end)
        {
            var result = await _i_Sys_Service.Get_Arrange(begin,end);

            return Ok(result);
        }


        /// <summary>
        /// 数据报表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_Report(string section)
        {
            var result = await _i_Sys_Service.Get_Report(section);

            return Ok(result);
        }

        /// <summary>
        /// 获取每个房间的待支付订单
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_Room_Order(string id,int? page=1,int? limit=999)
        {
            var result = await _i_Sys_Service.Get_Room_Order(new Orders_Dto
            {
                r_id=id,
                page=page ?? 1,
                limit=limit ?? 999,
            });

            return Ok(result);
        }


        

    }
}
